class queue {
    constructor() {
        this.cacheList = [];
    }

    add(delay,fn) {
        this.cacheList.push(()=> sleep(delay,fn))
        return this;
    }

    async task() {
        this.cacheList.forEach(fn => {
            await fn();
        })
    }

}